package com.redpill.linpro.transaction.impl;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.redpill.linpro.transaction.TransactionService;

public class TransactionServiceStub implements TransactionService {
	
	private final Logger logger = LoggerFactory.getLogger(TransactionServiceStub.class);
	
	private int beginTransactionCounter = 0;
	private int commitTransactionCounter = 0;
	private int rollbackTransactionCounter = 0;
	
	public void beginTransaction() {
		beginTransactionCounter++;
		logger.debug("Begin transaction");		
	}
	
	public void commit() {
		commitTransactionCounter++;
		logger.debug("Commit transaction");
	}
	
	public void rollback() {
		rollbackTransactionCounter++;
		logger.debug("Rollback transaction");
	}
	
	public int getBeginTransactionCounter() {
		return beginTransactionCounter;
	}
	
	public int getCommitTransactionCounter() {
		return commitTransactionCounter;
	}
	
	public int getRollbackTransactionCounter() {
		return rollbackTransactionCounter;
	}

}
